UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NfZ6fqe2hC+0cRH6mrEfS8WvePyZid8uYIUyTwuABiQ=' 
WHERE 
  key_id = '204e21bc859c91984f809fa3ecb7eb84df257f7816b38d697f3988a619a5acde' 
  AND (
    token = 'NfZ6fqe2hC+0cRH6mrEfS8WvePyZid8uYIUyTwuABiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038