UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+six68B8+pqtv3/9PDH8L2NtmHDvM2LSy2+wmJdtBk=' 
WHERE 
  key_id = 'c74e3f5f8e894e9a1bd8ca822439d38665cdba5d97aae6e6e40ef0c93d437c1e' 
  AND (
    token = '2+six68B8+pqtv3/9PDH8L2NtmHDvM2LSy2+wmJdtBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051