UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9INDz7TfJPbZ1NXzVSX3lJnlsUVuF9T+KdZ03dPFBdA=' 
WHERE 
  key_id = '3bef5f8ca10f5428afb45245dc88ccc816a279e57c9f5ac765c40ccc4d3a262f' 
  AND (
    token = '9INDz7TfJPbZ1NXzVSX3lJnlsUVuF9T+KdZ03dPFBdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060