UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4wIBmqNAcfbMzEk6hpj+YyxaDnjT7VECPheYu/t9VWA=' 
WHERE 
  key_id = '4fbbeea726fcc6fe69b6431352ca1670e841d0179775dd541268da7a03baa78e' 
  AND (
    token = '4wIBmqNAcfbMzEk6hpj+YyxaDnjT7VECPheYu/t9VWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035