UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KCx3rBudN2D1DSVe/2KNDxZg/cHqPehlj55S4iLVnxo='
WHERE
key_id = 'c41120c16bd43a43ac4ed5cda52ca51a0f980bf4726c82e1263b42ac00d758f0'
AND (
token = 'KCx3rBudN2D1DSVe/2KNDxZg/cHqPehlj55S4iLVnxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)