UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WtzvfPdQeayvx2VyovYEtT0hk+6+LAJNQHZWQ/4JTIs=' 
WHERE 
  key_id = 'cddbbe7ad57d6a683e08abcb06d65319f347898fd821ef7028a63bd5490a2326' 
  AND (
    token = 'WtzvfPdQeayvx2VyovYEtT0hk+6+LAJNQHZWQ/4JTIs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036