UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '35qJFk70VJq//4uFSNeLen+v8v0UDKHWNtLg/9TQbgE='
WHERE
key_id = '3d40962e560c749432afb0c151526a45ea57d095e0de7c87a306b9df3bd97ed6'
AND (
token = '35qJFk70VJq//4uFSNeLen+v8v0UDKHWNtLg/9TQbgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)