UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sC52Q5deqrhdFTqjtf+YibolHdi71XnTxtJLAWuwT3w='
WHERE
key_id = '0bf7a26c62c9854e0de71aa57ad86ac0c89eb7970cd7852547f2293ff7d17f66'
AND (
token = 'sC52Q5deqrhdFTqjtf+YibolHdi71XnTxtJLAWuwT3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)