UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTWbMOrpnXxr7GXF5+fEVvHMwD4zET2xEqeCGKhp5nk='
WHERE
key_id = '54b514461bda41bc8f997d02da8aeea832a996b124fbbe41de1a71bd8ddbccb1'
AND (
token = 'hTWbMOrpnXxr7GXF5+fEVvHMwD4zET2xEqeCGKhp5nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)