UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'veflC3tbKv5/W0MKvGZnInN6XeVhrhNt/uMhLk9ld1I=' 
WHERE 
  key_id = 'be9d6e2201eee13dbbf045976876731bd79d902ffd92e7ef285d822c7c0838fd' 
  AND (
    token = 'veflC3tbKv5/W0MKvGZnInN6XeVhrhNt/uMhLk9ld1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036