UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XVEQyB4+mU2yv7Tggqvaz9O7OQc+xpLKq+JfddOv8sQ='
WHERE
key_id = 'f4c07baedb5cd35cbc3b7cb21f6f92a263b9fa82a6169942ecb459425759d554'
AND (
token = 'XVEQyB4+mU2yv7Tggqvaz9O7OQc+xpLKq+JfddOv8sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)