UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qD37pIigmvLEos0OjGGxbKTQDvQBYZ2bc37PZdCa9hc=' 
WHERE 
  key_id = 'cb10c9884ef68a445c066479e413b943ccf596ca400573a21bfbcafb429544a5' 
  AND (
    token = 'qD37pIigmvLEos0OjGGxbKTQDvQBYZ2bc37PZdCa9hc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033