UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uoNgarOtC1e5dw96eorv9NFuikqOU5MwWXvL59hw1Mo=' 
WHERE 
  key_id = '193aa486b14c169622eef61e0bcdc5a46019a30a9723f18c09cfd5a9ae19d4e9' 
  AND (
    token = 'uoNgarOtC1e5dw96eorv9NFuikqOU5MwWXvL59hw1Mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022