UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jaLUUclKJLs4d50qSPDWv1I16PT5iblGzs2GNW06UmQ='
WHERE
key_id = '17bb7abfadee8ec7fca27ebb5cef5e1a891626c2719356ee4f54e43b957f10ce'
AND (
token = 'jaLUUclKJLs4d50qSPDWv1I16PT5iblGzs2GNW06UmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)