UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pXGmWL86ttve23vqvLTd7MZP+L4bRqr5QHi533t60cQ=' 
WHERE 
  key_id = '9bcb069c7292ebd24307bc3be885ce5f9b87d836d1a41a61461782bd10015744' 
  AND (
    token = 'pXGmWL86ttve23vqvLTd7MZP+L4bRqr5QHi533t60cQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030