UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/fFoDnrEx7h2vgdxvhB/V5tBETxr3P9QrQ3IfItdoI='
WHERE
key_id = '3a7914bfdfc31cfce81b516c7faed79349b0e87a6128877650b331e7509ea951'
AND (
token = 'a/fFoDnrEx7h2vgdxvhB/V5tBETxr3P9QrQ3IfItdoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)