UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uwTrWzyGD6MgJwTgMsNej3QB/6bz1jVIJdTE+WnpRis=' 
WHERE 
  key_id = 'ac724ea9f94162ee4541dbc000b0f0427fcb845ddf79bc66a0c73f5156a09d3c' 
  AND (
    token = 'uwTrWzyGD6MgJwTgMsNej3QB/6bz1jVIJdTE+WnpRis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015