UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LAvpCLU9yO1OTDLiHzeTnfBXFodoe0sIpmIPE3YRSm0='
WHERE
key_id = 'f5a76a945fa20a7a31b4a0bd9aa28ca1a51d0705fd4ca27c97f6b0c925e40bc0'
AND (
token = 'LAvpCLU9yO1OTDLiHzeTnfBXFodoe0sIpmIPE3YRSm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)