UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ekCg2kbKhV7k2Gjf/pGPELpc4S5aKN1W1q1sXSpN5QY=' 
WHERE 
  key_id = '0138790ab5931ca2c58dfecd48002431260d666b10d23dc1363688f18bdaf656' 
  AND (
    token = 'ekCg2kbKhV7k2Gjf/pGPELpc4S5aKN1W1q1sXSpN5QY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027