UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pswxiZJnQ7OJg54VGPtqzM0yfwq6OzaDNJE8qpKWBpc='
WHERE
key_id = '5a46b413f5aec8793ed93eeaae5b7eb7847d54b01f183eff95af4d5cae699118'
AND (
token = 'pswxiZJnQ7OJg54VGPtqzM0yfwq6OzaDNJE8qpKWBpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)