UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zyp8rcaA68ekB1I+iJZrgJnkkbuX73i79nUVxoUgGNk='
WHERE
key_id = '14f93ec22b0ba630e0d0fce1b138b84427706e18cd671a8455d04b543d3c5958'
AND (
token = 'zyp8rcaA68ekB1I+iJZrgJnkkbuX73i79nUVxoUgGNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)