UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+rdRtrI8h8oZYWlsHUEPGMgBLhANfproPXiEkqL86SI='
WHERE
key_id = 'c0bd3a364661e56e304898c87c44990e5d9022ebc1b4440ebdca94583ae9cd27'
AND (
token = '+rdRtrI8h8oZYWlsHUEPGMgBLhANfproPXiEkqL86SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)