UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'otlJI1SAJeIvH/5FlVxA3j6xFvhJJH83AJqTVM/yarg='
WHERE
key_id = '1620576118145f991a5c65f6824a7ae6ae6d2db25cea3c05f99e4fe0019f4177'
AND (
token = 'otlJI1SAJeIvH/5FlVxA3j6xFvhJJH83AJqTVM/yarg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)