UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'escyMhMjdWw1/7nJt1MU+Areuq2Ogb8YvFZsQZDCBYA=' 
WHERE 
  key_id = '7188704ab8c767edffa8022e827f5524171dfce6bd514e984066cd1ebf58b80b' 
  AND (
    token = 'escyMhMjdWw1/7nJt1MU+Areuq2Ogb8YvFZsQZDCBYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037