UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5tWkCDQxNRIoHuZWfpoAS5RVspkGkCh6re5hgJQi6Rs=' 
WHERE 
  key_id = '2ef7fdaa94cc64d894c39046767ac7bbcce5e8033a542511c4e6187bddf4e6c8' 
  AND (
    token = '5tWkCDQxNRIoHuZWfpoAS5RVspkGkCh6re5hgJQi6Rs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027