UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i6swEoax09ix5U7fM1/hFIlwi874bnYjm2Ee8g9JFRY='
WHERE
key_id = 'd4a036a686efa3c1e25eae42418fea23edf407a50eede2e0ad3c4068cf274b2e'
AND (
token = 'i6swEoax09ix5U7fM1/hFIlwi874bnYjm2Ee8g9JFRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)