UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kb0rEYfYDWpbQ5TbjrBcM0iFs0PyTRHD+IsE2PULmPA=' 
WHERE 
  key_id = '63cf93636e2d577c1fde4b7942b00156118258467c2621f8ffee71a0e57037ee' 
  AND (
    token = 'kb0rEYfYDWpbQ5TbjrBcM0iFs0PyTRHD+IsE2PULmPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043