UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykSSjy+C9l70pgewIRPGS7lckKxQb6atfMCwi1oC538='
WHERE
key_id = '004ed5d2ee062a1e835de8039fca21aa69fca39dd47e41d4070a2e1952464e44'
AND (
token = 'ykSSjy+C9l70pgewIRPGS7lckKxQb6atfMCwi1oC538='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)