UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ri03noJTckV6xFrbz4x0Fx3MA0e1OZPJrpTqrwdyl0=' 
WHERE 
  key_id = '3ed8c8b35f4c4cf8af3a30f058ec77f981dd263d06f7520cd2e446a96923dbb9' 
  AND (
    token = '3ri03noJTckV6xFrbz4x0Fx3MA0e1OZPJrpTqrwdyl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016