UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6gdAKmqYqZSN+xjzfIif76umHmTW27f0MYov9FA/TIA=' 
WHERE 
  key_id = 'da3e3f1edd2c3a744e2360e353ade4a3a34f29baa9084ca336d553c65e15ff02' 
  AND (
    token = '6gdAKmqYqZSN+xjzfIif76umHmTW27f0MYov9FA/TIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053