UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jmBqOjpBN3652yQORha/0TofxbP/tv89OkNui0F5B9Y=' 
WHERE 
  key_id = '095b2fea5399184ef5b611219bf1050a8226125054bc7c955bb5edc8480dd70c' 
  AND (
    token = 'jmBqOjpBN3652yQORha/0TofxbP/tv89OkNui0F5B9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028