UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hucbDEFhCYQSwVT53JXJW4egES9OfJWr70D4jyb0u4c='
WHERE
key_id = '32ba87c69045fbef7b0b4199e3fa3069fde45312b5a7e3f2b8694f3879fd2b00'
AND (
token = 'hucbDEFhCYQSwVT53JXJW4egES9OfJWr70D4jyb0u4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)